namespace CIS
{
    using CISLib;
    using CISLib.EncryptClasses;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class CustomerProfile : Page
    {
        protected TextBox AllergyTxb;
        protected DropDownList BirthDayDdl;
        protected TextBox birthDayTxb;
        protected DropDownList BirthMonthDdl;
        protected TextBox birthMonthTxb;
        protected TextBox BirthPlaceTxb;
        protected DropDownList BirthYearDdl;
        protected TextBox birthYearTxb;
        protected DropDownList bloodTypeDdl;
        protected TextBox bloodTypeTxb;
        protected TextBox BrandPreTxb;
        protected DropDownList catDdl;
        protected TextBox catTxb;
        protected DropDownList companyDdl;
        protected TextBox companyTxb;
        protected TextBox customerNameTxb;
        protected TextBox departTxb;
        protected TextBox EmailTxb;
        protected DropDownList EyesightDdl;
        protected TextBox eyesightTxb;
        protected DropDownList genderDdl;
        protected TextBox genderTxb;
        protected DropDownList HealthDdl;
        protected TextBox healthTxb;
        protected TextBox HeightTxb;
        protected TextBox HipMeasurementTxb;
        protected Label lbAllergy;
        protected Label lbBDate;
        protected Label lbBirth;
        protected Label lbBirthPlace;
        protected Label lbBloodType;
        protected Label lbBMonth;
        protected Label lbBrandPre;
        protected Label lbBYear;
        protected Label lbCat;
        protected Label lbClothingSituation;
        protected Label lbCompany;
        protected Label lbCustomerName;
        protected Label lbDepart;
        protected Label lbEyesight;
        protected Label lbGender;
        protected Label lbHealth;
        protected Label lbHealthSituation;
        protected Label lbHeight;
        protected Label lbHip;
        protected Label lbHomeAdd;
        protected Label lbHomeTel;
        protected Label lbInch1;
        protected Label lbInch2;
        protected Label lbInch3;
        protected Label lbLevel;
        protected Label lbMail;
        protected Label lbMailAdd;
        protected Label lbMajorOperation;
        protected Label lbMarriage;
        protected Label lbMDate;
        protected Label lbMMonth;
        protected Label lbMobile;
        protected Label lbMYear;
        protected Label lbNeck;
        protected Label lbProduct;
        protected Label lbRegion;
        protected Label lbRelocationAdd;
        protected Label lbShoes;
        protected Label lbSpcHobbiex;
        protected Label lbSpecialDisease;
        protected Label lbStrLevel1;
        protected Label lbStrLevel2;
        protected Label lbStrLevel3;
        protected Label lbStrLevel4;
        protected Label lbStrLevel5;
        protected Label lbTitle;
        protected Label lbTranSportTool;
        protected Label lbType;
        protected Label lbWeight;
        protected DropDownList levelDdl;
        protected TextBox levelTxb;
        protected TextBox MailAddTxb;
        protected TextBox MajorOperationTxb;
        protected DropDownList MarriageDateDdl;
        protected TextBox marriageDateTxb;
        protected DropDownList MarriageMonthDdl;
        protected TextBox marriageMonthTxb;
        protected DropDownList MarriageYearDdl;
        protected TextBox marriageYearTxb;
        protected TextBox MobileTxb;
        protected TextBox NeckMeasurementTxb;
        protected ListBox PaperLB;
        protected UserPrincipal Principal = null;
        protected ListBox ProductLB;
        protected DropDownList regionDdl;
        protected TextBox regionTxb;
        protected RegularExpressionValidator RegularExpressionValidatorEmail;
        protected RegularExpressionValidator RegularexpressionvalidatorMobile;
        protected RegularExpressionValidator RegularexpressionvalidatorTel1;
        protected RegularExpressionValidator RegularexpressionvalidatorTel2;
        protected RegularExpressionValidator RegularexpressionvalidatorTel3;
        protected TextBox RelocationAddTxb;
        protected RequiredFieldValidator RequiredFieldValidatorName;
        protected Repeater rptASBContract;
        protected Repeater rptASBEvents;
        protected Repeater rptASBReception;
        protected Repeater rptCustomerCompetitorEvents;
        protected Repeater rptCustomerCompetitorMeeting;
        protected Repeater rptCustomerEvent;
        protected Repeater rptCustomerRelations;
        protected Repeater rptCustomerResponsibleStaff;
        protected Repeater rptCustomerTrain;
        protected Repeater rptEVMeeting;
        protected Repeater rptFamily;
        protected Repeater rptImage;
        protected Repeater rptPre;
        protected Repeater rptStudy;
        protected Repeater rptTravel;
        protected Repeater rptVisitingAbroad;
        protected Repeater rptWork;
        protected TextBox ShoesSizeTxb;
        protected TextBox SpcHobbiexTxb;
        protected TextBox SpecialDiseaseTxb;
        protected TextBox titleTxb;
        protected TextBox transportTollUsedTxb;
        protected DropDownList TransportToolUsedDdl;
        protected TextBox TxbHomeAdd;
        protected TextBox TxbHomeTel1;
        protected TextBox TxbHomeTel2;
        protected TextBox TxbHomeTel3;
        protected DropDownList TypeDdl;
        protected TextBox typeTxb;
        protected TextBox WeightTxb;

        protected string AddStrPrefixASBContract(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerASBContractPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixASBEvents(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerASBEventsPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixASBReception(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerASBReceptionPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixASBTraining(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerASBTrainingPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixCompetitorEvents(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerCompetitorEventsPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixCompetitorMeeting(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerCompetitorMeetingPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixEvents(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerEventsPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixEVMeeting(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerEVMeetingPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixFamily(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("CustomerInfoFamilyPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixPic(object obj, string strPre)
        {
            if (obj.ToString() == string.Empty)
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerPicPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixRelations(object obj, string strPre)
        {
            if (obj.ToString() == string.Empty)
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerRelationsPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixResponsibleStaff(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerResponsibleStaffPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixStudy(object obj, string strPre)
        {
            if (obj.ToString() == string.Empty)
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("CustomerInfoStudyPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixTravel(object obj, string strPre)
        {
            if (obj.ToString() == string.Empty)
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("CustomerInfoTravelPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixVisitingAbroad(object obj, string strPre)
        {
            if ((obj.ToString() == string.Empty) || (obj.ToString() == "\0\0\0\0"))
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("OtherCustomerVisitingAbroadPage", strPre, language, path) + obj.ToString());
        }

        protected string AddStrPrefixWork(object obj, string strPre)
        {
            if (obj.ToString() == string.Empty)
            {
                return "";
            }
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            return (ManageSystemConfig.GetSystemSetLanguage("CustomerInfoWorkPage", strPre, language, path) + obj.ToString());
        }

        private string choosePageTitle(string pageType)
        {
            if (pageType == "1")
            {
                return "《上海贝尔阿尔卡特》";
            }
            if (pageType == "2")
            {
                return "《伙伴》";
            }
            if (pageType == "3")
            {
                return "《方案与服务》";
            }
            if (pageType == "4")
            {
                return "《阿尔卡特电信技术展望》";
            }
            return "";
        }

        private void DateBindNewsPaper()
        {
            CustomerNewsPaper[] customerNewsPaper = ManageCustomer.GetCustomerNewsPaperAryViaId(new Guid(base.Request.QueryString["CustomerId"]));
            this.PaperLB.Items.Clear();
            for (int i = 0; i < customerNewsPaper.Length; i++)
            {
                this.PaperLB.Items.Add(new ListItem(this.choosePageTitle(customerNewsPaper[i].NewsPaperType), customerNewsPaper[i].CustomerNewsPaperId.ToString()));
            }
        }

        protected string DecryptStringASBContract(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringASBEvents(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringASBReception(object obj)
        {
            return ManageOther.DecodeWithBytes(obj.ToString());
        }

        protected string DecryptStringCompetitorEvents(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringCompetitorMeeting(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringEvents(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringEVMeeting(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringFamily(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringPic(object obj)
        {
            return ManageOther.DecodeWithBytes(obj.ToString());
        }

        protected string DecryptStringRelations(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringResponsibleStaff(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringStudy(object obj)
        {
            return ManageOther.DecodeWithBytes(obj.ToString());
        }

        protected string DecryptStringTravel(object obj)
        {
            return ManageOther.DecodeWithBytes(obj.ToString());
        }

        protected string DecryptStringVisitingAbroad(object obj)
        {
            DESEncrypt mydes = new DESEncrypt();
            return mydes.DecryptString(obj.ToString());
        }

        protected string DecryptStringWork(object obj)
        {
            return ManageOther.DecodeWithBytes(obj.ToString());
        }

        protected string DecryptUnicodeStringASBContract(object obj)
        {
            return ManageOther.DecodeWithBytes(obj.ToString());
        }

        private void FillPageASBContract()
        {
            this.RptDataBindASBContract();
        }

        private void FillPageASBEvents()
        {
            this.RptDataBindASBEvents();
        }

        private void FillPageASBReception()
        {
            this.RptDataBindASBReception();
        }

        private void FillPageASBTraining()
        {
            this.RptDataBindASBTraining();
        }

        private void FillPageBasic()
        {
            try
            {
                string language = this.Session["language"].ToString();
                Guid customerId = new Guid(base.Request.QueryString["CustomerId"].ToString());
                CustomerBasicInfo customerBasicInfo = ManageCustomer.GetCustomerBasicInfoViaId(customerId);
                Product[] productEdit = ManageProduct.GetProductAryViaId(customerId);
                for (int i = 0; i < productEdit.Length; i++)
                {
                    ListItem tmpListItem = new ListItem();
                    switch (language)
                    {
                        case "cn":
                            tmpListItem.Text = productEdit[i].ProductNameCn;
                            break;

                        case "en":
                            tmpListItem.Text = productEdit[i].ProductNameEn;
                            break;
                    }
                    tmpListItem.Value = productEdit[i].ProductId.ToString();
                    this.ProductLB.Items.Add(tmpListItem);
                }
                this.EmailTxb.Text = customerBasicInfo.CustomerEmail;
                this.customerNameTxb.Text = customerBasicInfo.Name;
                this.titleTxb.Text = customerBasicInfo.Title;
                this.departTxb.Text = customerBasicInfo.Depart;
                this.MailAddTxb.Text = customerBasicInfo.MailAdd;
                this.genderTxb.Text = customerBasicInfo.Gender;
                this.levelTxb.Text = "Level " + customerBasicInfo.Level.ToString();
                this.companyTxb.Text = ManageCompany.GetCompanyViaId(customerBasicInfo.CompanyId).CompanyName;
                this.regionTxb.Text = ManageProvince.GetProvinceViaId(customerBasicInfo.RegionId).ProvinceName;
                this.catTxb.Text = ManageCAT.GetCATViaId(customerBasicInfo.CatId).CatName;
                this.typeTxb.Text = ManageCustomerDef.GetDefViaId(customerBasicInfo.CustomerDefId).DefName;
                this.SetInfoTypeDdl(this.genderDdl, customerBasicInfo.Gender);
                this.SetInfoTypeDdl(this.levelDdl, customerBasicInfo.Level.ToString());
                this.SetInfoTypeDdl(this.companyDdl, customerBasicInfo.CompanyId.ToString());
                this.SetInfoTypeDdl(this.regionDdl, customerBasicInfo.RegionId.ToString());
                this.SetInfoTypeDdl(this.catDdl, customerBasicInfo.CatId.ToString());
                this.SetInfoTypeDdl(this.TypeDdl, customerBasicInfo.CustomerDefId.ToString());
                this.Page.Session.Add("CustomerId", customerId);
                if ((this.Principal.SysUser.IsAdmin <= 0) && !ManageSystemConfig.IsThisCustomerMaster(this.Principal.SysUser.UserId, customerId))
                {
                    this.customerNameTxb.ReadOnly = true;
                    this.titleTxb.ReadOnly = true;
                    this.departTxb.ReadOnly = true;
                    this.EmailTxb.ReadOnly = true;
                }
            }
            catch (Exception)
            {
            }
        }

        private void FillPageCompetitorEvents()
        {
            this.RptDataBindCompetitorEvents();
        }

        private void FillPageCompetitorMeeting()
        {
            this.RptDataBindCompetitorMeeting();
        }

        private void FillPageEvents()
        {
            this.RptDataBindEvents();
        }

        private void FillPageEVMeeting()
        {
            this.RptDataBindEVMeeting();
        }

        private void FillPageFamily()
        {
            this.RptDataBindFamily();
        }

        private void FillPageForCostume()
        {
            if (ManageCustomer.IsExistSameCoustomerCostumeInfo(new Guid(base.Request.QueryString["CustomerId"])))
            {
                try
                {
                    CustomerCostumeInfo customerCostumeInfo = new CustomerCostumeInfo();
                    customerCostumeInfo = ManageCustomer.GetCustomerCostumeInfoViaId(new Guid(base.Request.QueryString["CustomerId"].ToString()));
                    this.NeckMeasurementTxb.Text = customerCostumeInfo.NeckMeasurement;
                    this.ShoesSizeTxb.Text = customerCostumeInfo.ShoesSize;
                    this.HipMeasurementTxb.Text = customerCostumeInfo.HipMeasurement;
                    this.BrandPreTxb.Text = customerCostumeInfo.BrandPre;
                }
                catch (Exception)
                {
                }
            }
        }

        private void FillPageForHealth()
        {
            if (ManageCustomer.IsExistSameCoustomerHealthInfo(new Guid(base.Request.QueryString["CustomerId"])))
            {
                try
                {
                    CustomerHealth customerHealth = new CustomerHealth();
                    customerHealth = ManageCustomer.GetCustomerHealthViaId(new Guid(base.Request.QueryString["CustomerId"].ToString()));
                    this.MajorOperationTxb.Text = customerHealth.MajorOperation;
                    this.SpecialDiseaseTxb.Text = customerHealth.SpecialDisease;
                    this.AllergyTxb.Text = customerHealth.Allergy;
                    for (int i = 0; i < this.HealthDdl.Items.Count; i++)
                    {
                        if (this.HealthDdl.Items[i].Value == customerHealth.HealthStatus.ToString())
                        {
                            this.HealthDdl.SelectedIndex = i;
                            break;
                        }
                    }
                    this.healthTxb.Text = this.HealthDdl.SelectedItem.Text;
                    for (int i = 0; i < this.EyesightDdl.Items.Count; i++)
                    {
                        if (this.EyesightDdl.Items[i].Value == customerHealth.Eyesight.ToString())
                        {
                            this.EyesightDdl.SelectedIndex = i;
                            break;
                        }
                    }
                    this.eyesightTxb.Text = this.EyesightDdl.SelectedItem.Text;
                }
                catch (Exception)
                {
                }
            }
        }

        private void FillPageNewsPaper()
        {
            this.DateBindNewsPaper();
        }

        private void FillPagePersonal()
        {
            this.SetFromPersonal();
            Guid customerId = new Guid(base.Request.QueryString["CustomerId"]);
            if ((this.Principal.SysUser.IsAdmin <= 0) && !ManageSystemConfig.IsThisCustomerMaster(this.Principal.SysUser.UserId, customerId))
            {
                this.BirthPlaceTxb.ReadOnly = true;
                this.TxbHomeAdd.ReadOnly = true;
                this.RelocationAddTxb.ReadOnly = true;
                this.TxbHomeTel1.ReadOnly = true;
                this.TxbHomeTel2.ReadOnly = true;
                this.TxbHomeTel3.ReadOnly = true;
                this.MobileTxb.ReadOnly = true;
                this.WeightTxb.ReadOnly = true;
                this.HeightTxb.ReadOnly = true;
                this.SpcHobbiexTxb.ReadOnly = true;
            }
            if (ManageCustomer.IsExistSameCoustomerPersonalInfo(new Guid(base.Request.QueryString["CustomerId"])))
            {
                try
                {
                    CustomerPersonalInfo customerPersonalInfo = new CustomerPersonalInfo();
                    customerPersonalInfo = ManageCustomer.GetCustomerPersonalInfoViaId(new Guid(base.Request.QueryString["CustomerId"].ToString()));
                    try
                    {
                        if (((customerPersonalInfo.MarriageDate.Year != 0x708) || (customerPersonalInfo.MarriageDate.Month != 1)) || (customerPersonalInfo.MarriageDate.Day != 1))
                        {
                            this.marriageYearTxb.Text = customerPersonalInfo.MarriageDate.Year.ToString();
                            this.marriageMonthTxb.Text = customerPersonalInfo.MarriageDate.Month.ToString();
                            this.marriageDateTxb.Text = customerPersonalInfo.MarriageDate.Day.ToString();
                            for (int i = 0; i < this.MarriageYearDdl.Items.Count; i++)
                            {
                                if (this.MarriageYearDdl.Items[i].Text == customerPersonalInfo.MarriageDate.Year.ToString())
                                {
                                    this.MarriageYearDdl.SelectedIndex = i;
                                    break;
                                }
                            }
                            for (int i = 0; i < this.MarriageMonthDdl.Items.Count; i++)
                            {
                                if (this.MarriageMonthDdl.Items[i].Text == customerPersonalInfo.MarriageDate.Month.ToString())
                                {
                                    this.MarriageMonthDdl.SelectedIndex = i;
                                    break;
                                }
                            }
                            for (int i = 0; i < this.MarriageDateDdl.Items.Count; i++)
                            {
                                if (this.MarriageDateDdl.Items[i].Text == customerPersonalInfo.MarriageDate.Day.ToString())
                                {
                                    this.MarriageDateDdl.SelectedIndex = i;
                                    break;
                                }
                            }
                        }
                        if (((customerPersonalInfo.BirthDate.Year != 0x708) || (customerPersonalInfo.BirthDate.Month != 1)) || (customerPersonalInfo.BirthDate.Day != 1))
                        {
                            this.birthYearTxb.Text = customerPersonalInfo.BirthDate.Year.ToString();
                            this.birthMonthTxb.Text = customerPersonalInfo.BirthDate.Month.ToString();
                            this.birthDayTxb.Text = customerPersonalInfo.BirthDate.Day.ToString();
                            for (int i = 0; i < this.BirthYearDdl.Items.Count; i++)
                            {
                                if (this.BirthYearDdl.Items[i].Text == customerPersonalInfo.BirthDate.Year.ToString())
                                {
                                    this.BirthYearDdl.SelectedIndex = i;
                                    break;
                                }
                            }
                            for (int i = 0; i < this.BirthMonthDdl.Items.Count; i++)
                            {
                                if (this.BirthMonthDdl.Items[i].Text == customerPersonalInfo.BirthDate.Month.ToString())
                                {
                                    this.BirthMonthDdl.SelectedIndex = i;
                                    break;
                                }
                            }
                            for (int i = 0; i < this.BirthDayDdl.Items.Count; i++)
                            {
                                if (this.BirthDayDdl.Items[i].Text == customerPersonalInfo.BirthDate.Day.ToString())
                                {
                                    this.BirthDayDdl.SelectedIndex = i;
                                    break;
                                }
                            }
                        }
                        string strBloodType = customerPersonalInfo.BloodType;
                        strBloodType = strBloodType.Substring(0, strBloodType.IndexOf("\0"));
                        for (int i = 0; i < this.bloodTypeDdl.Items.Count; i++)
                        {
                            if (this.bloodTypeDdl.Items[i].Text == strBloodType)
                            {
                                this.bloodTypeDdl.SelectedIndex = i;
                                goto Label_052E;
                            }
                        }
                    }
                    catch (Exception)
                    {
                        return;
                    }
                Label_052E:
                    this.BirthPlaceTxb.Text = customerPersonalInfo.BirthPlace;
                    this.TxbHomeAdd.Text = customerPersonalInfo.FamilyAdd;
                    this.RelocationAddTxb.Text = customerPersonalInfo.RelocationAdd;
                    string[] strTelAry = customerPersonalInfo.PersonalTele.Split(new char[] { '-' });
                    this.TxbHomeTel1.Text = strTelAry[0];
                    this.TxbHomeTel2.Text = strTelAry[1];
                    this.TxbHomeTel3.Text = strTelAry[2];
                    this.MobileTxb.Text = customerPersonalInfo.Mobile;
                    for (int i = 0; i < this.bloodTypeDdl.Items.Count; i++)
                    {
                        if (this.bloodTypeDdl.Items[i].Value == customerPersonalInfo.BloodType)
                        {
                            this.bloodTypeDdl.SelectedIndex = i;
                            break;
                        }
                    }
                    this.bloodTypeTxb.Text = this.bloodTypeDdl.SelectedItem.Text;
                    this.WeightTxb.Text = customerPersonalInfo.Weight;
                    this.HeightTxb.Text = customerPersonalInfo.Height;
                    this.SpcHobbiexTxb.Text = customerPersonalInfo.SpecicalHobbies;
                }
                catch (Exception)
                {
                }
            }
        }

        private void FillPagePic()
        {
            this.rptImage.DataSource = ManageCustomer.GetCustomerImageInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptImage.DataBind();
        }

        private void FillPageRelations()
        {
            this.RptDataBindRelations();
        }

        private void FillPageResponsibleStaff()
        {
            this.RptDataBindResponsibleStaff();
        }

        private void FillPageStudy()
        {
            this.RptDataBindStudy();
        }

        private void FillPageTravel()
        {
            Guid customerId = new Guid(base.Request.QueryString["CustomerId"]);
            for (int i = 0; i < this.TransportToolUsedDdl.Items.Count; i++)
            {
                if (this.TransportToolUsedDdl.Items[i].Value == ManageCustomer.GetCustomerTravelInfoOfTranTool(customerId))
                {
                    this.TransportToolUsedDdl.SelectedIndex = i;
                    break;
                }
            }
            this.transportTollUsedTxb.Text = this.TransportToolUsedDdl.SelectedItem.Text;
            if ((this.Principal.SysUser.IsAdmin <= 0) && !ManageSystemConfig.IsThisCustomerMaster(this.Principal.SysUser.UserId, customerId))
            {
            }
            this.RptDataBindTravel();
        }

        private void FillPageVisitingAbroad()
        {
            this.RptDataBindVisitingAbroad();
        }

        private void FillPageWork()
        {
            this.RptDataBindWork();
        }

        private void FillrptPre()
        {
            Guid customerId = new Guid(base.Request.QueryString["CustomerId"]);
            this.rptPre.DataSource = ManagePreference.GetCustomerPreferenceInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptPre.DataBind();
        }

        protected string GetTrainSchoolASBTraining(object obj)
        {
            Guid[] CustomerSchoolId = ManageCustomer.GetCustomerSchoolIdAryViaCustomerTrainId((Guid) obj);
            string result = "";
            for (int i = 0; i < CustomerSchoolId.Length; i++)
            {
                CustomerSchool school = ManageCustomerSchool.GetCustomerSchoolViaId(CustomerSchoolId[i]);
                result = result + school.SchoolName + " ";
            }
            return result;
        }

        protected string GetTrainTypeASBTraining(object obj)
        {
            return ManageCustomerTrain.GetCustomerTrainViaId((Guid) obj).TrainName;
        }

        private void InitializeComponent()
        {
            base.Load += new EventHandler(this.Page_Load);
        }

        private void InitPageBasic()
        {
            this.SetFromBasic();
            Province[] provinceAry = this.Principal.Province;
            for (int i = 0; i < provinceAry.Length; i++)
            {
                ListItem tmpItem = new ListItem();
                tmpItem.Text = provinceAry[i].ProvinceName;
                tmpItem.Value = provinceAry[i].ProvinceId.ToString();
                this.regionDdl.Items.Add(tmpItem);
            }
            Cat[] catAry = this.Principal.OwnCat;
            for (int i = 0; i < catAry.Length; i++)
            {
                ListItem tmpItem = new ListItem();
                tmpItem.Text = catAry[i].CatName;
                tmpItem.Value = catAry[i].CatId.ToString();
                this.catDdl.Items.Add(tmpItem);
            }
            this.genderDdl.Items.Clear();
            ListItem nullItem = new ListItem();
            nullItem.Text = "";
            ListItem maleItem = new ListItem();
            maleItem.Text = "男";
            ListItem femaleItem = new ListItem();
            femaleItem.Text = "女";
            this.genderDdl.Items.Add(nullItem);
            this.genderDdl.Items.Add(maleItem);
            this.genderDdl.Items.Add(femaleItem);
            this.levelDdl.Items.Clear();
            ListItem blankItem = new ListItem();
            blankItem.Text = string.Empty;
            blankItem.Value = "0";
            this.levelDdl.Items.Add(blankItem);
            for (int i = 1; i <= 5; i++)
            {
                string tmpStr = "Level " + i.ToString();
                ListItem tmpItem = new ListItem();
                tmpItem.Text = tmpStr;
                tmpItem.Value = i.ToString();
                this.levelDdl.Items.Add(tmpItem);
            }
            this.companyDdl.Items.Clear();
            Area[] areaAry = this.Principal.OwnArea;
            DataTable dataTable = new DataTable();
            int y = 0;
            for (int i = 0; i < areaAry.Length; i++)
            {
                for (int j = 0; j < catAry.Length; j++)
                {
                    for (int x = 0; x < provinceAry.Length; x++)
                    {
                        DataTable dt = ManageCompany.GetCompany(catAry[j].CatId, provinceAry[x].ProvinceId, areaAry[i].AreaId).Tables[0];
                        if (y == 0)
                        {
                            dataTable = dt.Clone();
                            y++;
                        }
                        foreach (DataRow tmpRow in dt.Rows)
                        {
                            dataTable.ImportRow(tmpRow);
                        }
                    }
                }
            }
            this.companyDdl.DataSource = dataTable;
            this.companyDdl.DataTextField = "CompanyName";
            this.companyDdl.DataValueField = "CompanyId";
            this.companyDdl.DataBind();
            switch (this.Session["language"].ToString())
            {
                case "cn":
                    if (this.Principal.OwnArea.Length > 1)
                    {
                        this.TypeDdl.DataSource = ManageCustomerDef.GetCustomerDef();
                        this.TypeDdl.DataTextField = "DefName";
                        this.TypeDdl.DataValueField = "DefId";
                    }
                    else if (this.Principal.OwnArea.Length == 1)
                    {
                        this.TypeDdl.DataSource = ManageCustomerDef.GetCustomerDef(this.Principal.OwnArea[0].AreaId);
                        this.TypeDdl.DataTextField = "DefName";
                        this.TypeDdl.DataValueField = "DefId";
                    }
                    break;

                case "en":
                    if (this.Principal.OwnArea.Length > 1)
                    {
                        this.TypeDdl.DataSource = ManageCustomerDef.GetCustomerDef();
                        this.TypeDdl.DataTextField = "DefNameEn";
                        this.TypeDdl.DataValueField = "DefId";
                    }
                    else if (this.Principal.OwnArea.Length == 1)
                    {
                        this.TypeDdl.DataSource = ManageCustomerDef.GetCustomerDef(this.Principal.OwnArea[0].AreaId);
                        this.TypeDdl.DataTextField = "DefNameEn";
                        this.TypeDdl.DataValueField = "DefId";
                    }
                    break;
            }
            this.TypeDdl.DataBind();
            Company com = ManageCompany.GetCompanyViaId(new Guid(this.companyDdl.SelectedValue));
            this.MailAddTxb.Text = com.CompanyAdd + " " + com.CompanyZip;
        }

        private void InitPageHealth()
        {
            this.SetFromHealth();
            string language = this.Session["language"].ToString();
            if (language == "cn")
            {
                this.HealthDdl.Items.Clear();
                ListItem healthItem0 = new ListItem();
                healthItem0.Text = " ";
                healthItem0.Value = "3";
                ListItem healthItem1 = new ListItem();
                healthItem1.Text = "良好";
                healthItem1.Value = "0";
                ListItem healthItem2 = new ListItem();
                healthItem2.Text = "一般";
                healthItem2.Value = "1";
                ListItem healthItem3 = new ListItem();
                healthItem3.Text = "较差";
                healthItem3.Value = "2";
                this.HealthDdl.Items.Add(healthItem0);
                this.HealthDdl.Items.Add(healthItem1);
                this.HealthDdl.Items.Add(healthItem2);
                this.HealthDdl.Items.Add(healthItem3);
            }
            else if (language == "en")
            {
                this.HealthDdl.Items.Clear();
                ListItem healthItem0 = new ListItem();
                healthItem0.Text = " ";
                healthItem0.Value = "3";
                ListItem healthItem1 = new ListItem();
                healthItem1.Text = "Good";
                healthItem1.Value = "0";
                ListItem healthItem2 = new ListItem();
                healthItem2.Text = "Commonly";
                healthItem2.Value = "1";
                ListItem healthItem3 = new ListItem();
                healthItem3.Text = "Bad";
                healthItem3.Value = "2";
                this.HealthDdl.Items.Add(healthItem0);
                this.HealthDdl.Items.Add(healthItem1);
                this.HealthDdl.Items.Add(healthItem2);
                this.HealthDdl.Items.Add(healthItem3);
            }
            if (language == "cn")
            {
                this.EyesightDdl.Items.Clear();
                ListItem EyesightItem0 = new ListItem();
                EyesightItem0.Text = " ";
                EyesightItem0.Value = "3";
                ListItem EyesightItem1 = new ListItem();
                EyesightItem1.Text = "良好";
                EyesightItem1.Value = "0";
                ListItem EyesightItem2 = new ListItem();
                EyesightItem2.Text = "一般";
                EyesightItem2.Value = "1";
                ListItem EyesightItem3 = new ListItem();
                EyesightItem3.Text = "较差";
                EyesightItem3.Value = "2";
                this.EyesightDdl.Items.Add(EyesightItem0);
                this.EyesightDdl.Items.Add(EyesightItem1);
                this.EyesightDdl.Items.Add(EyesightItem2);
                this.EyesightDdl.Items.Add(EyesightItem3);
            }
            else if (language == "en")
            {
                this.EyesightDdl.Items.Clear();
                ListItem EyesightItem0 = new ListItem();
                EyesightItem0.Text = " ";
                EyesightItem0.Value = "3";
                ListItem EyesightItem1 = new ListItem();
                EyesightItem1.Text = "Good";
                EyesightItem1.Value = "0";
                ListItem EyesightItem2 = new ListItem();
                EyesightItem2.Text = "Commonly";
                EyesightItem2.Value = "1";
                ListItem EyesightItem3 = new ListItem();
                EyesightItem3.Text = "Bad";
                EyesightItem3.Value = "2";
                this.EyesightDdl.Items.Add(EyesightItem0);
                this.EyesightDdl.Items.Add(EyesightItem1);
                this.EyesightDdl.Items.Add(EyesightItem2);
                this.EyesightDdl.Items.Add(EyesightItem3);
            }
        }

        private void InitPagePersonal()
        {
            this.bloodTypeDdl.Items.Clear();
            ListItem bloodTypeItem0 = new ListItem();
            bloodTypeItem0.Text = " ";
            ListItem bloodTypeItem1 = new ListItem();
            bloodTypeItem1.Text = "0";
            ListItem bloodTypeItem2 = new ListItem();
            bloodTypeItem2.Text = "A";
            ListItem bloodTypeItem3 = new ListItem();
            bloodTypeItem3.Text = "B";
            ListItem bloodTypeItem4 = new ListItem();
            bloodTypeItem4.Text = "AB";
            this.bloodTypeDdl.Items.Add(bloodTypeItem0);
            this.bloodTypeDdl.Items.Add(bloodTypeItem1);
            this.bloodTypeDdl.Items.Add(bloodTypeItem2);
            this.bloodTypeDdl.Items.Add(bloodTypeItem3);
            this.bloodTypeDdl.Items.Add(bloodTypeItem4);
            this.BirthYearDdl.Items.Clear();
            this.BirthMonthDdl.Items.Clear();
            this.BirthDayDdl.Items.Clear();
            ListItem tmpItem = new ListItem();
            tmpItem.Text = "----";
            this.BirthYearDdl.Items.Add(tmpItem);
            ListItem tmpItem1 = new ListItem();
            tmpItem1.Text = "--";
            this.BirthMonthDdl.Items.Add(tmpItem1);
            this.BirthDayDdl.Items.Add(tmpItem1);
            for (int i = DateTime.Now.Year; i >= 0x78a; i--)
            {
                ListItem YearItem = new ListItem();
                YearItem.Text = i.ToString();
                this.BirthYearDdl.Items.Add(YearItem);
            }
            for (int i = 1; i <= 12; i++)
            {
                ListItem MonthItem = new ListItem();
                MonthItem.Text = i.ToString();
                this.BirthMonthDdl.Items.Add(MonthItem);
            }
            for (int i = 1; i <= 0x1f; i++)
            {
                ListItem DateItem = new ListItem();
                DateItem.Text = i.ToString();
                this.BirthDayDdl.Items.Add(DateItem);
            }
            this.MarriageYearDdl.Items.Clear();
            this.MarriageMonthDdl.Items.Clear();
            this.MarriageDateDdl.Items.Clear();
            ListItem tmpItem2 = new ListItem();
            tmpItem2.Text = "----";
            this.MarriageYearDdl.Items.Add(tmpItem);
            ListItem tmpItem3 = new ListItem();
            tmpItem3.Text = "--";
            this.MarriageMonthDdl.Items.Add(tmpItem1);
            this.MarriageDateDdl.Items.Add(tmpItem1);
            for (int i = DateTime.Now.Year; i >= 0x78a; i--)
            {
                ListItem YearItem = new ListItem();
                YearItem.Text = i.ToString();
                this.MarriageYearDdl.Items.Add(YearItem);
            }
            for (int i = 1; i <= 12; i++)
            {
                ListItem MonthItem = new ListItem();
                MonthItem.Text = i.ToString();
                this.MarriageMonthDdl.Items.Add(MonthItem);
            }
            for (int i = 1; i <= 0x1f; i++)
            {
                ListItem DateItem = new ListItem();
                DateItem.Text = i.ToString();
                this.MarriageDateDdl.Items.Add(DateItem);
            }
        }

        private void InitPageStudy()
        {
        }

        private void InitPageTravel()
        {
            this.SetFromTravel();
            ListItem tmpItem0 = new ListItem();
            ListItem tmpItem1 = new ListItem();
            ListItem tmpItem2 = new ListItem();
            ListItem tmpItem3 = new ListItem();
            ListItem tmpItem4 = new ListItem();
            switch (this.Session["language"].ToString())
            {
                case "cn":
                    tmpItem0.Text = "";
                    tmpItem1.Text = "飞机";
                    tmpItem2.Text = "火车";
                    tmpItem3.Text = "汽车";
                    tmpItem4.Text = "船只";
                    tmpItem0.Value = "";
                    tmpItem1.Value = "1";
                    tmpItem2.Value = "2";
                    tmpItem3.Value = "3";
                    tmpItem4.Value = "4";
                    break;

                case "en":
                    tmpItem0.Text = "";
                    tmpItem1.Text = "Plans";
                    tmpItem2.Text = "Train";
                    tmpItem3.Text = "Auto";
                    tmpItem4.Text = "Ship";
                    tmpItem0.Value = "";
                    tmpItem1.Value = "1";
                    tmpItem2.Value = "2";
                    tmpItem3.Value = "3";
                    tmpItem4.Value = "4";
                    break;
            }
            this.TransportToolUsedDdl.Items.Add(tmpItem0);
            this.TransportToolUsedDdl.Items.Add(tmpItem1);
            this.TransportToolUsedDdl.Items.Add(tmpItem2);
            this.TransportToolUsedDdl.Items.Add(tmpItem3);
            this.TransportToolUsedDdl.Items.Add(tmpItem4);
        }

        protected override void OnInit(EventArgs e)
        {
            this.InitializeComponent();
            base.OnInit(e);
            this.Principal = this.Context.User as UserPrincipal;
        }

        private void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                this.InitPageBasic();
                this.FillPageBasic();
                this.SetFromBasic();
                this.InitPagePersonal();
                this.FillPagePersonal();
                this.SetFromPersonal();
                this.FillrptPre();
                this.InitPageHealth();
                this.FillPageForHealth();
                this.FillPageForCostume();
                this.InitPageTravel();
                this.FillPageTravel();
                this.InitPageStudy();
                this.FillPageStudy();
                this.FillPageWork();
                this.FillPageFamily();
                this.FillPageASBContract();
                this.FillPageEVMeeting();
                this.FillPageVisitingAbroad();
                this.FillPageASBTraining();
                this.FillPageASBEvents();
                this.FillPageEvents();
                this.FillPageRelations();
                this.FillPageResponsibleStaff();
                this.FillPageASBReception();
                this.FillPageCompetitorMeeting();
                this.FillPageCompetitorEvents();
                this.FillPageNewsPaper();
                this.FillPagePic();
            }
        }

        private void RptDataBindASBContract()
        {
            this.rptASBContract.DataSource = ManageCustomer.GetCustomerASBContractInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptASBContract.DataBind();
        }

        private void RptDataBindASBEvents()
        {
            this.rptASBEvents.DataSource = ManageCustomer.GetCustomerASBEventsInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptASBEvents.DataBind();
        }

        private void RptDataBindASBReception()
        {
            this.rptASBReception.DataSource = ManageCustomer.GetCustomerASBReceptionInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptASBReception.DataBind();
        }

        private void RptDataBindASBTraining()
        {
            this.rptCustomerTrain.DataSource = ManageCustomer.GetCustomerTrainInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptCustomerTrain.DataBind();
        }

        private void RptDataBindCompetitorEvents()
        {
            this.rptCustomerCompetitorEvents.DataSource = ManageCustomer.GetCustomerCompetitorEventsInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptCustomerCompetitorEvents.DataBind();
        }

        private void RptDataBindCompetitorMeeting()
        {
            this.rptCustomerCompetitorMeeting.DataSource = ManageCustomer.GetCustomerCompetitorMeetingInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptCustomerCompetitorMeeting.DataBind();
        }

        private void RptDataBindEvents()
        {
            this.rptCustomerEvent.DataSource = ManageCustomer.GetCustomerEventsInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptCustomerEvent.DataBind();
        }

        private void RptDataBindEVMeeting()
        {
            this.rptEVMeeting.DataSource = ManageCustomer.GetCustomerEVMeetingInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptEVMeeting.DataBind();
        }

        private void RptDataBindFamily()
        {
            this.rptFamily.DataSource = ManageCustomer.GetCustomerFamilyInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptFamily.DataBind();
        }

        private void RptDataBindRelations()
        {
            this.rptCustomerRelations.DataSource = ManageCustomer.GetCustomerRelationsInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptCustomerRelations.DataBind();
        }

        private void RptDataBindResponsibleStaff()
        {
            this.rptCustomerResponsibleStaff.DataSource = ManageCustomer.GetCustomerResponsibleStaffInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptCustomerResponsibleStaff.DataBind();
        }

        private void RptDataBindStudy()
        {
            this.rptStudy.DataSource = ManageCustomer.GetCustomerStudyExperienceInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptStudy.DataBind();
        }

        private void RptDataBindTravel()
        {
            this.rptTravel.DataSource = ManageCustomer.GetCustomerTravelInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptTravel.DataBind();
        }

        private void RptDataBindVisitingAbroad()
        {
            this.rptVisitingAbroad.DataSource = ManageCustomer.GetCustomerVisitingAbroadInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptVisitingAbroad.DataBind();
        }

        private void RptDataBindWork()
        {
            this.rptWork.DataSource = ManageCustomer.GetCustomerWorkExperienceInfo(new Guid(base.Request.QueryString["CustomerId"]));
            this.rptWork.DataBind();
        }

        protected string SelectLanguagePreference(string preType)
        {
            string language = this.Session["language"].ToString();
            if (preType == "PreferenceNameCn")
            {
                switch (language)
                {
                    case "cn":
                        return "PreferenceNameCn";

                    case "en":
                        return "PreferenceNameEn";
                }
            }
            else if (preType == "PreferenceValueNameCn")
            {
                switch (language)
                {
                    case "cn":
                        return "PreferenceValueNameCn";

                    case "en":
                        return "PreferenceValueNameEn";
                }
            }
            else if (preType == "PreferenceLevelNameCn")
            {
                switch (language)
                {
                    case "cn":
                        return "PreferenceLevelNameCn";

                    case "en":
                        return "PreferenceLevelNameEn";
                }
            }
            return "";
        }

        protected string SetDegreeStrStudy(object obj)
        {
            switch (this.Session["language"].ToString())
            {
                case "cn":
                    return obj.ToString();
            }
            switch (((string) obj))
            {
                case "大专以下":
                    return "Below";

                case "大专":
                    return "College";

                case "本科":
                    return "Bachelor";

                case "硕士":
                    return "Master";

                case "博士":
                    return "doctor";

                case "MBA":
                    return "MBA";

                case "EMBA":
                    return "EMBA";

                case "DBA":
                    return "DBA";
            }
            return "";
        }

        private void SetFromBasic()
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            this.lbCustomerName.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbCustomerName", language, path);
            this.lbGender.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbGender", language, path);
            this.lbTitle.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbTitle", language, path);
            this.lbStrLevel2.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbStrLevel2", language, path);
            this.lbLevel.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbLevel", language, path);
            this.lbStrLevel1.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbStrLevel1", language, path);
            this.RequiredFieldValidatorName.ErrorMessage = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "RequiredFieldValidatorName", language, path);
            this.lbStrLevel3.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbStrLevel3", language, path);
            this.lbStrLevel4.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbStrLevel4", language, path);
            this.lbStrLevel5.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbStrLevel5", language, path);
            this.lbCompany.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbCompany", language, path);
            this.lbDepart.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbDepart", language, path);
            this.lbProduct.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbProduct", language, path);
            this.lbType.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbType", language, path);
            this.lbMail.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbMail", language, path);
            this.lbMailAdd.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerBasicInfoPage", "lbMailAdd", language, path);
        }

        private void SetFromHealth()
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            this.lbHealthSituation.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbHealthSituation", language, path);
            this.lbHealth.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbHealth", language, path);
            this.lbEyesight.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbEyesight", language, path);
            this.lbMajorOperation.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbMajorOperation", language, path);
            this.lbSpecialDisease.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbSpecialDisease", language, path);
            this.lbAllergy.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbAllergy", language, path);
            this.lbClothingSituation.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbClothingSituation", language, path);
            this.lbNeck.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbNeck", language, path);
            this.lbShoes.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbShoes", language, path);
            this.lbHip.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbHip", language, path);
            this.lbBrandPre.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbBrandPre", language, path);
            this.lbInch1.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbInch1", language, path);
            this.lbInch2.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbInch2", language, path);
            this.lbInch3.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoHealthCostumePage", "lbInch3", language, path);
        }

        private void SetFromPersonal()
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            this.lbBirth.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbBirth", language, path);
            this.lbBYear.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbBYear", language, path);
            this.lbBMonth.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbBMonth", language, path);
            this.lbBDate.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbBDate", language, path);
            this.lbMYear.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbMYear", language, path);
            this.lbMMonth.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbMMonth", language, path);
            this.lbMDate.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbMDate", language, path);
            this.lbBirthPlace.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbBirthPlace", language, path);
            this.lbMarriage.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbMarriage", language, path);
            this.lbHomeAdd.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbHomeAdd", language, path);
            this.lbRelocationAdd.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbRelocationAdd", language, path);
            this.lbHomeTel.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbHomeTel", language, path);
            this.lbMobile.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbMobile", language, path);
            this.lbBloodType.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbBloodType", language, path);
            this.lbWeight.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbWeight", language, path);
            this.lbHeight.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbHeight", language, path);
            this.lbSpcHobbiex.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoPersonalPage", "lbSpcHobbiex", language, path);
        }

        private void SetFromTravel()
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/CIS/LanguageConfig.xml");
            this.lbTranSportTool.Text = ManageSystemConfig.GetSystemSetLanguage("CustomerInfoTravelPage", "lbTranSportTool", language, path);
        }

        private void SetInfoTypeDdl(DropDownList tepDDL, string strValue)
        {
            for (int i = 0; i < tepDDL.Items.Count; i++)
            {
                if (tepDDL.Items[i].Value == strValue)
                {
                    tepDDL.SelectedIndex = i;
                    break;
                }
            }
        }

        protected string SetVenueLanguageVisitingAbroad(object obj)
        {
            string language = this.Session["language"].ToString();
            string strABVenue = obj.ToString();
            strABVenue = strABVenue.Substring(0, strABVenue.IndexOf("\0"));
            string[] strABVenueAry = strABVenue.Split(new char[] { ',' });
            string cnName = ConfigurationSettings.AppSettings["CountryCh"];
            string enName = ConfigurationSettings.AppSettings["CountryEn"];
            string[] cnAry = cnName.Split(new char[] { ',' });
            string[] enAry = enName.Split(new char[] { ',' });
            string strTmp = "";
            switch (language)
            {
                case "cn":
                    for (int i = 0; i < strABVenueAry.Length; i++)
                    {
                        for (int j = 0; j < enAry.Length; j++)
                        {
                            if (strABVenueAry[i] == enAry[j])
                            {
                                strTmp = strTmp + cnAry[j] + ",";
                            }
                        }
                    }
                    if (strTmp == "")
                    {
                        return strTmp;
                    }
                    return strTmp.Substring(0, strTmp.Length - 1);

                case "en":
                    return strABVenue;
            }
            return strTmp;
        }

        protected string ValidateDateTime(object tmpObj)
        {
            string strTmp = tmpObj.ToString();
            if (strTmp.Substring(0, 4) == "1800")
            {
                return "---- -- --";
            }
            return strTmp;
        }

        protected string ValidateDateTimeASBContract(object tmpObj)
        {
            string strTmp = tmpObj.ToString();
            if (strTmp.Substring(0, 4) == "1800")
            {
                return "---- -- --";
            }
            return strTmp;
        }

        protected string ValidateDateTimeFamily(object tmpObj)
        {
            string strTmp = tmpObj.ToString();
            if (strTmp == "1800-01-01")
            {
                return "---- -- --";
            }
            return strTmp;
        }

        protected string ValidateDateTimeStudy(object tmpObj)
        {
            string strTmp = tmpObj.ToString();
            if (strTmp.Substring(0, 4) == "1800")
            {
                return "---- -- ";
            }
            return strTmp;
        }

        protected string ValidateDateTimeWork(object tmpObj)
        {
            string strTmp = tmpObj.ToString();
            if (strTmp.Substring(0, 4) == "1800")
            {
                return "---- --";
            }
            return strTmp;
        }
    }
}

